# Grade_To_Letter_Converter.py # # Description: Write a Letter Grade converter # that converts a grade into a letter grade: # A -> 90 to 100 # B -> 80 to 89 # C -> 70 to 79 # D -> 60 to 69 # E -> 50 to 59 # F -> 0 to 49 # # Author: Anne Lavergne # Date: M Jan. 22 2024 # Ask the user for a grade and read the grade theGrade = int(input("Please, enter a grade between 0 and 100 (whole #): ")) # User input validation if theGrade < 0 or theGrade > 100: print("The grade you entered is either < 0 or > 100!") print("Please, try again!") else: # If the grade is between 90 and 100 (inclusively), the letter is A if theGrade >= 90 and theGrade <= 100: print("A") # If the grade is between 80 and 89 (inclusively), the letter is B elif theGrade >= 80 and theGrade <= 89: print("B") # If the grade is between 70 and 79 (inclusively), the letter is C elif theGrade >= 70 and theGrade <= 79: print("C") # If the grade is between 60 and 69 (inclusively), the letter is D elif theGrade >= 60 and theGrade <= 69: print("D") # If the grade is between 50 and 59 (inclusively), the letter is E elif theGrade >= 50 and theGrade <= 59: print("E") # If the grade is between 0 and 49 (inclusively), the letter is F else: print("F") print("Bye!")